var enter =  $.getUrlParam('pass')
window.onload = function() {
	var EmpNo = $.getUrlParam('UserID')
	var date_year = new Date().getFullYear()
	var date_mon = new Date().getMonth()
	date_mon = date_mon.toString().length<2?"0"+(date_mon-1):date_mon-1
	var date_new = date_year + date_mon
	$("#mondate").val(date_year+"-"+date_mon)
	$("#mondate")[0].onblur = function(e){  
   		var num = this.value
   		var year = num.slice(0,4);
   		var mon = num.slice(5,7);
   		num = year + mon
   		date_new = num
		submit_gongzi()
	}; 
	function submit_gongzi(){
		var wsUrl = 'http://drpapi.kukahome.com:8099/Lookfor/trans';
		var data;
		data = '<?xml version="1.0" encoding="utf-8"?>';
		data = data + '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
		data = data + '<soap:Body>';
		data = data + '<GetUserSalary xmlns="http://tempuri.org/">';
		data = data + '<Page_no>1</Page_no>';
		data = data + '<Page_size>10</Page_size>';
		data = data + '<EmpNo>'+EmpNo+'</EmpNo>';
		data = data + '<Passport>' + enter + '</Passport>';
		data = data + '<yearmonth>'+date_new+'</yearmonth>';
		data = data + '</GetUserSalary>';
		data = data + '</soap:Body>';
		data = data + '</soap:Envelope>';
		var datav = {
				data:data,
				"SOAPAction": "http://tempuri.org/GetUserSalary"
		}
		var soap = datav
		$.ajax({
			"url": wsUrl,
			"type": 'POST',
			"async": false,
			"dataType": 'text',
			"data": soap,
			"success": function(data) {
				var moneydata = $(data).find("GetUserSalaryResult").text()
				moneydata = JSON.parse(moneydata)
				moneydata = moneydata.TB_V_SALARYINFOTB_V_SALARYINFO
				$("#ulbox").empty()
				if(moneydata.length>=1){
					moneydata[0].rows.map(function(i){
						console.log(i)
						var bodyv = '<li class="light_Font">'+
									'<span class="moneyname">'+i.caption+':</span>'+
									'<span class="data_num">&#x3000;'+i.values+'</span>'+
									'</li>'
						$("#ulbox").append(bodyv)
					})
				}
			},
			"error": function(data) {
				$("#hint").html("网络出问题了")
			},
			headers: {
				"Content-Type": 'application/x-www-form-urlencoded',
//				Accept: "XML",
//				"Content-Type": 'text/xml;charset=UTF-8',
//				"SOAPAction": "http://tempuri.org/GetUserSalary",
			}
		});
	}
}